<!DOCTYPE html>
<html>

<head>
    <include file="Share:meta" />
    <script src="../Public/plugins/jsFormat/jsFormat.js"></script>
    <script type="text/javascript">
    function jsFormat(id) {
        try{
            str = formatJson($('#' + id).html(), {});
            $('#' + id).html(str);
        }catch(e){
            console.log(e);
        }
        
    }
    </script>
    <style type="text/css">
        div.jsFor {
            white-space: pre;
            font-size: 14px;
            font-family: Courier, monospace;
        }
    </style>
</head>

<body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <include file="Share:header" />
        <include file="Share:left" />
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>博饼<small></small></h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li class="active">博饼</li>
                </ol>
            </section>
            <!-- Main content -->
            <section class="content">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">添加新博饼机会</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal" action="" method="post">
                        <input type="hidden" name="id" value="{$info.id}"></input>
                        <div class="box-body">
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">备注</label>
                                <div class="col-sm-10">
                                    <input type="text" name="note" id="inputEventCode" class="form-control" value="{$info.note}" placeholder="请填写消费描述" required="required" autocomplete="off">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">次数</label>
                                <div class="col-sm-10">
                                    <input type="number" name="count" id="inputEventCode" class="form-control" value="{$info.count}" placeholder="请填写博饼次数" required="required" autocomplete="off">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">中奖状态</label>
                                <div class="col-sm-10">
                                    <input type="text" name="status" id="inputEventCode" class="form-control" value="{$info.status}" autocomplete="off">
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer col-sm-offset-2">
                            <button type="submit" class="btn btn-primary">
                                <eq name="info" value="">新增
                                    <else />保存</eq>
                            </button>
                            <a class="btn btn-warning" href="/Event/bobing" role="button">返回</a>
                        </div>
                        <br>
                        <!-- /.box-footer -->
                    </form>
                </div>
                <neq name="info" value="">
                    <div class="box box-info">
                        <div class="box-body">
                            <table class="table table-bordered HjTable" border="1">
                                <tbody>
                                    <tr>
                                        <th>博饼结果</th>
                                        <th>时间</th>
                                        <th>奖品</th>
                                        <th>备注</th>
                                        <th>操作</th>
                                    </tr>
                                    <volist name="list" id="vo">
                                    <form method="POST" action="__APP__/Admin/Event/save/id/{$Think.get.id}/rid/{$vo.id}">
                                        <tr class='trstyle{$vo.status}'>
                                            <td title="{$vo.dice}">{$vo.title}</td>
                                            <td>{$vo.time}</td>
                                            <td>
                                                <select name="wid" id="wid{$vo.id}" class="form-control" required="required">
                                                    <option></option>
                                                    <volist name="wlist" id="vo1">
                                                        <eq name="vo1.ref1" value="$vo.title">
                                                        <option value="{$vo1.wid}">{$vo1.subject} 剩余：{$vo1.count}份</option>
                                                        </eq>
                                                    </volist>
                                                </select>
                                                <script type="text/javascript">
                                                    $("#wid{$vo.id}").val('{$vo.wid}');
                                                </script>
                                                <notempty name="vo.wid">
                                                    <script type="text/javascript">
                                                        $('#wid{$vo.id}').attr('disabled','disabled');
                                                    </script>

                                                </notempty>
                                            </td>
                                            <td><input type="text" name="note" id="input" class="form-control" value="{$vo.note}"></td>
                                            <td><button type="submit" class="btn btn-primary">保存</button></td>
                                        </tr>
                                    </form>
                                    </volist>
                                </tbody>
                            </table>
                        </div>
                        <div style="height: 400px; display: block;"></div>
                    </div>
                </neq>
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <include file="Share:copyright" />
        <include file="Share:setting" />
    </div>
    <include file="Share:js" />
    <script type="text/javascript">
    $("#Menu_Event").addClass("active");
    $(document).ready(function() {
        $(":input").inputmask();
    });
    </script>
</body>

</html>
